package ooday02;
/** 家族测试类 */
public class PersonTest {
    public static void main(String[] args) {
    Student zg = new Student();
    zg.name = "张光";
    zg.age = 25;
    zg.address = "山东烟台";
    zg.className = "jsd2312";
    zg.stuId = "001";
    zg.sayHi();
    zg.eat();
    zg.sleep();
    zg.study();
    Student zl = new Student("赵亮",23,"哈尔滨","jsd2312","002");
    zl.sayHi();
    zl.eat();
    zl.sleep();
    zl.study();

    Teacher wkj = new Teacher("王克晶",39,"北京",25000.0);
    wkj.sayHi();
    wkj.eat();
    wkj.sleep();
    wkj.teach();

    Doctor ch =new Doctor("陈汉",45,"重庆","主任医生");
    ch.sayHi();
    ch.eat();
    ch.sleep();
    ch.cut();

    //演示超类不能访问派生类的
        Person p = new Person();
        p.name = "人";
        p.age = 1;
        p.address = "未知";
        p.sayHi();
        p.eat();
        p.sleep();
       // p.study();//编译错误,超类不能访问派生类

    }
}
